fix: a half written record is named for what it is, not called somebody else's - #72
Merged
Merged
Conversation
…dy else's This tool has two markers for a file it started and did not finish. "<final>.tfg-partial-<pid>" is a file being produced. "<final>.tfg-writing" is the half written copy of a file that already exists - the manifest being written over an earlier one, or the recipe that "recipe fmt -w" formats in place. Both survive a hard kill, and the reading side knew only the first. So verify reported our own half written manifest as "extra", the word it uses for a file somebody else put in the directory. A person was told their fixtures were polluted by something this tool had written itself. The argument against this was already written down, on core.PartialMarker: "A second spelling would mean verify reports our own leftovers as files it knows nothing about, which is what it did until 2026-08-03." It was written, applied to one marker, and then the other marker arrived with its literal duplicated - an unexported constant in core/replace.go and a bare literal in manifest.go - and no reader taught about either. A written reason is a claim until something can turn red on it, which is why the second guard here asks about the SOURCE rather than the behaviour: that one would have caught this, and the behaviour one would not have caught it coming back. The two get different sentences on purpose. A half written generated file costs nothing, because the manifest does not describe it. A half written RECORD is the case where somebody has to look: the run was saving the list of what it produced, so the directory can hold finished files that nothing lists, and cleanup cannot remove those - untouchable rule 7. Three mutations, all caught, and a fourth repointed after staleness.py found it had gone stale on the line this changes. Not fixed here, and measured rather than assumed: verify still reports a second manifest and that run's files as "extra" when two runs share a directory through output.manifest. Two runs with different target ids both exit 0 and then verify a.json gives four differences, not one. That is a question about what verify means, so it is the owner's. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stability report finding T5. Reproduced on today's tree before fixing.
What was wrong
This tool has two markers for a file it started and did not finish:
<final>.tfg-partial-<pid><final>.tfg-writingrecipe fmt -wformats in placeBoth survive a hard kill. Only the first was recognised, so
verifyreported our own half written manifest asextra- the word it uses for a file somebody else put in the directory. A person was told their fixtures were polluted by something this tool had written itself.The part worth reading
The argument against this was already written down, and it did not help. From the comment on
core.PartialMarker:It was written, applied to one marker, and then the other marker arrived with its literal duplicated - an unexported constant in
core/replace.goand a bare literal inmanifest.go- and no reader taught about either.So there are two guards, and the second is the one that matters:
TestAHalfWrittenRecordIsNamedForWhatItIs- the behaviourTestEachLeftoverMarkerIsSpelledInOnePlace- the source. This one would have caught the original defect, and the behaviour one would not have caught it coming back.A written reason is a claim until something can turn red on it.
Two sentences, on purpose
A half written generated file costs nothing - the manifest does not describe it, nothing is missing, delete it.
A half written record is the one case where somebody has to look: the run was saving the list of what it produced, so the directory can hold finished files that nothing lists, and
cleanupcannot remove those (untouchable rule 7). It now says that.A mutation that routes the record through the other sentence is in the set.
Checks
staleness.pyfound the existingaudit.goentry had gone stale on the very line this changespreflight --quickgreen on all 12 checksNot fixed here, and measured rather than assumed
verifystill reports a second manifest and that run's files asextrawhen two runs share a directory throughoutput.manifest- which is what that setting exists to permit. Two runs with different target ids, bothexit 0:Four differences, not one. The report (T8) described only the manifest file, so recognising it would fix one of four. What the rest should be is a question about what
verify <manifest>means when a directory is shared, which is a contract decision rather than a fix.🤖 Generated with Claude Code